<template>
  <context-menu ref="contextMenu">  
      <context-menu-item label="菜单项 1" @click="onMenuItemClick"></context-menu-item>  
      <context-menu-item label="菜单项 2" @click="onMenuItemClick"></context-menu-item>  
    </context-menu> 
</template>

<script lang="ts">
import { ContextMenu, ContextMenuItem } from '@imengyu/vue3-context-menu';  
import { defineComponent, ref, reactive, defineExpose } from 'vue';
import type { MenuOptions } from '@imengyu/vue3-context-menu';

const contextMenu=ref(null)
const show = ref(false);
const showItem = ref(true);


const onContextMenu = (e: any,taget:any) => {
//   e.preventDefault();
  //Set the mouse position
  contextMenu.value.showMenu(e, taget);
  //Show menu
  show.value = true;
};
defineExpose({
  onContextMenu, 
});
</script>